﻿using System;
using System.Runtime.InteropServices.ComTypes;
using Avalonia.Controls;

namespace AvaloniaApplication1;

public class CustomDialog:Window
{
    private TextBlock txtBlock = new TextBlock(){Width = 200, Height = 100};
    
    public CustomDialog()
    {
        StackPanel sp = new StackPanel(){Width = 200, Height = 200};

        txtBlock.Name = "tb";
        sp.Children.Add(txtBlock);
        Content = sp;
    }

    public void Test(string msg)
    {
        try
        {
            txtBlock.Text = msg; 
            this.Show();
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }
    }

}